![]() |
PATH![]() |
![]() ![]() |
Sets the background color or pattern of the current port to be consistent with that of an embedding object.
pascal OSStatus ApplyThemeBackground (
ThemeBackgroundKind inKind,
const Rect *bounds,
ThemeDrawState inState,
SInt16 inDepth,
Boolean inColorDev);
The ApplyThemeBackground function sets the background color or pattern of the current port to match the background of an embedding object, such as a placard or tab control. Your application should call ApplyThemeBackground before erasing the background of your application's content to ensure that the content background matches that of the object in which it is visually embedded.
ApplyThemeBackground aligns patterns based on the rectangle passed in the bounds parameter. This is in contrast to the function SetThemeBackground , which aligns patterns based on the origin of the current port.
You do not need to call ApplyThemeBackground if your content is an embedded part within a control hierarchy and is logically as well as visually embedded in its container; in this case, the Control Manager automatically requests the embedding control to set up the background before drawing the embedded control.
If you have a custom control definition function that erases its background before drawing, you should use the Control Manager function SetUpControlBackground before erasing. SetUpControlBackground calls ApplyThemeBackground if necessary.